package model.member;

import java.sql.SQLException;
import java.util.HashMap;

import com.ibatis.sqlmap.client.SqlMapClient;

public class MemberDao {
	private SqlMapClient sqlMapClient;
	public void setSqlMapClient(SqlMapClient sqlMapClient){
		this.sqlMapClient=sqlMapClient;
	}
	public MemberVO login(MemberVO vo) throws SQLException{
		return (MemberVO) sqlMapClient.queryForObject("login",vo);
	}
	public void update(MemberVO vo) throws SQLException{
		sqlMapClient.update("update",vo);
	}
	public MemberVO idCheck(String id) throws SQLException {
		//System.out.println(id);
		return (MemberVO) sqlMapClient.queryForObject("idCheck",id);
	}
	public MemberVO nickCheck(String nick) throws SQLException {
		return (MemberVO)sqlMapClient.queryForObject("nickCheck",nick);
	}
	public void registerMember(MemberVO vo) throws SQLException {
		sqlMapClient.insert("registerMember",vo);
	}
	public HashMap notDuplicate(String uri) throws SQLException{
		return (HashMap)sqlMapClient.queryForObject("not_duplicate",uri);
	}
	//회원수 조회
	public String countId() throws SQLException{
		return (String)sqlMapClient.queryForObject("countId");
	}
}
